package com.atguigu.dga.governance.service.impl;

import com.atguigu.dga.governance.bean.GovernanceAssessTable;
import com.atguigu.dga.governance.bean.GovernanceAssessTecOwner;
import com.atguigu.dga.governance.mapper.GovernanceAssessTecOwnerMapper;
import com.atguigu.dga.governance.service.GovernanceAssessTecOwnerService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import com.baomidou.dynamic.datasource.annotation.DS;

import java.util.List;

/**
 * <p>
 * 技术负责人治理考评表 服务实现类
 * </p>
 *
 * @author zhangchen
 * @since 2024-08-02
 */
@Service
@DS("dga")
public class GovernanceAssessTecOwnerServiceImpl extends ServiceImpl<GovernanceAssessTecOwnerMapper, GovernanceAssessTecOwner> implements GovernanceAssessTecOwnerService {




    public  void  generateAssessTecOwner(String assessDate){
        // 1.先删除之前的数据
        this.remove(new QueryWrapper<GovernanceAssessTecOwner>().eq("assess_date",assessDate));
        // 2.根据考评结果汇总表级考评结果
        List<GovernanceAssessTecOwner> governanceAssessTecOwnerList  = this.baseMapper.selectAssessTecOwnerList(assessDate);
        //3 保存
        this.saveBatch(governanceAssessTecOwnerList);

    }
}
